package com.ht.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @ProjectName: ht
 * @ClassName: SwaggerConfig
 * @Author: hejialun
 * @Description: swagger2
 * @Date: 2021/4/28 11:18
 */
@Configuration
@ConditionalOnProperty(prefix = "mconfig", name = "swagger-ui-open", havingValue = "true")
public class SwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI().info(new Info()
                .title("接口文档")
                .version("v1.0")
                .description("这是一个基于 springdoc-openapi 的 Swagger 文档示例"));
    }
}